package com.sufen.seckill.study.FaceCoding;

import java.util.Scanner;

public class ListNodeInput {
    public static class ListNode{
        int val;
        ListNode next;
        public ListNode(){}
        public ListNode(int val){
            this.val=val;
        }
    }

    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);

        String tmp=in.nextLine();

        int n=tmp.length();

        String s= tmp.substring(1,n-1);
//        System.out.print(s);

        String[] num=s.split(",");

        ListNode hair=new ListNode(0);
        ListNode res=hair;

        for(String t:num){
            int nb=Integer.parseInt(t);

            hair.next=new ListNode(nb);
            hair=hair.next;
        }
        res=res.next;
        while(res!=null){
            System.out.print(res.val+" ");
            res=res.next;
        }

    }
}
